package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;


import com.kaishengit.pojo.News;
import com.kaishengit.pojo.Project;

@Repository
public class NewsDao extends BaseDao<News, String> {
	
	public  List<News> findByProject(Project project) {
		String hql = "from News where projectid = :id Order by createtime desc";
		Query query = getSession().createQuery(hql);		
		query.setParameter("id", project);
		
		@SuppressWarnings("unchecked")
		List<News> newsList=query.list();
		return newsList;
	}
}
